<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    // 1.var定义的变量是会默认添加到window上的
    var message = 'hello world';
    var address = '广州市'
    console.log(window.message);
    console.log(window.address);

    // 2.let/const定义的变量不会添加到window上的
    let message1 = 'hello world';
    let address1 = '广州市'
    console.log(window.message1);
    console.log(window.address1);
    
    // 3.let/var分别声明变量
    var message3 = "Hello World"
    let adress3 = "广州市"

    function foo() {
      debugger
    }
    foo()

  </script>
</body>

</html>